<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @scope enchant.JGZ.Dialog.prototype
<span class='line'>  3</span>  */</span><span class="WHIT">
<span class='line'>  4</span> </span><span class="NAME">enchant.JGZ.Box</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">enchant.Class.create</span><span class="PUNC">(</span><span class="NAME">enchant.Sprite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>  6</span>    * Dialogの表示を行う
<span class='line'>  7</span>    * @constructs
<span class='line'>  8</span>    * @param {Object} opt {x: X座標, y: Y座標, renderPosition: 表示位置の指定}
<span class='line'>  9</span>    */</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">  </span><span class="NAME">initialize</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">opt</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">    </span><span class="NAME">Sprite.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">340</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span> 
<span class='line'> 13</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">game</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">enchant.Game.instance</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT">    </span><span class="NAME">this.image</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">game.assets</span><span class="PUNC">[</span><span class="NAME">LIB_IMAGE_PATH</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'bg_dialog.png'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span> 
<span class='line'> 16</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opt.renderPosition</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">      </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opt.renderPosition</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">position</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">enchant.JGZ.MathPosition</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">        </span><span class="NAME">position.setCenter</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">          </span><span class="STRN">'type'</span><span class="WHIT">    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">opt.renderPosition</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">          </span><span class="STRN">'selfW'</span><span class="WHIT">   </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">340</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">          </span><span class="STRN">'selfH'</span><span class="WHIT">   </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">          </span><span class="STRN">'targetW'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">game.width</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">          </span><span class="STRN">'targetH'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">game.height</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">          </span><span class="STRN">'targetX'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">          </span><span class="STRN">'targetY'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 30</span> 
<span class='line'> 31</span> </span><span class="WHIT">      </span><span class="NAME">this.x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">position.x</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">      </span><span class="NAME">this.y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">position.y</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">      </span><span class="NAME">this.x</span><span class="WHIT">      </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">opt.x</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">      </span><span class="NAME">this.y</span><span class="WHIT">      </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">opt.y</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span></pre></body></html>